const seq = require('../../seq')
const {STRING, INTEGER, TEXT, DATE} = require('../../types')

const Ask = seq.define('ask', {
  content: {
    type: STRING,
    allowNull: false,
    comment: '请求内容'
  },
  rent: {
    type: INTEGER,
    allowNull: false,
    comment: '期待租金'
  },
  startTime: {
    type: DATE,
    allowNull: false,
    comment: '开始时间'
  },
  endTime: {
    type: DATE,
    allowNull: false,
    comment: '结束时间'
  },
  houseId: {
    type: INTEGER,
    allowNull: false,
    comment: '房屋id'
  },
  askId: {
    type: INTEGER,
    allowNull: false,
    comment: '发起者id'
  },
  reason: {
    type: TEXT,
    allowNull: true,
    comment: '房东原因'
  },
  status: {
    type: INTEGER,
    allowNull: null,
    comment: '状态 1-等待房东回复 2-等待租客回复 3-房东拒绝 4-租客拒绝 5-发起合约'
  }
})

module.exports = Ask
